/**
 * 
 */
package org.tio.sitexxx.im.common.converter;

import org.tio.core.ChannelContext;
import org.tio.sitexxx.im.common.utils.ImUtils;
import org.tio.sitexxx.service.vo.SimpleUser;
import org.tio.utils.convert.Converter;

/**
 * @author tanyaowu
 *
 */
public class SimpleUserConverter implements Converter<SimpleUser> {

	public static final SimpleUserConverter me = new SimpleUserConverter();

	public static final SimpleUserConverter supper = new SimpleUserConverter(true);

	@SuppressWarnings("unused")
	private boolean isSupper = false;

	/**
	 * 
	 */
	private SimpleUserConverter() {

	}

	private SimpleUserConverter(boolean isSupper) {
		this.isSupper = isSupper;
	}

	@Override
	public SimpleUser convert(Object value) {
		ChannelContext channelContext = (ChannelContext) value;
		SimpleUser handshakeSimpleUser = ImUtils.getHandshakeSimpleUser(channelContext);
		return handshakeSimpleUser;
	}

}
